<?php
// wcf imports
require_once(WCF_DIR.'lib/data/message/bbcode/BBCodeParser.class.php');
require_once(WCF_DIR.'lib/data/message/bbcode/BBCode.class.php');

/*
 * @svn			$Id: OfftopicBBCode.class.php 388 2009-09-27 15:57:48Z TobiasH87 $
 * @package		de.community4wcf.wcf.bbcode.news
 */
 
class NewsBBCode implements BBCode {
	/**
	 * @see BBCode::getParsedTag()
	 */
	public function getParsedTag($openingTag, $content, $closingTag, BBCodeParser $parser) {
		if ($parser->getOutputType() == 'text/html') {
			// show template
			WCF::getTPL()->assign(array(
				'content' => $content,
				'newsTitle' => (!empty($openingTag['attributes'][0]) ? $openingTag['attributes'][0] : '')
			));
			return WCF::getTPL()->fetch('newsBBCodeTag');
		}
		else if ($parser->getOutputType() == 'text/plain') {
			return $content;
		}
	}
}
?>